File systems are primarily concerned with the overall management of files in a computer system. Among other things, file systems generally contain methods for (1) providing for files to be stored, referenced, shared and secured; (2) accessing data stored in files; and (3) maintaining file integrity to ensure that the information in a file remains uncorrupted.
One file system, which is used in the MS-DOS operating system, uses a File Allocation Table (FAT table) to assist in the performance of the above-described functions. This FAT file system requires a large number of sectors at the beginning of the disk for holding FAT meta data structures such as the boot sector, the FAT table and the Root directory. The FAT file system manages files by grouping the sectors or areas on the disk into a finite set of clusters or allocation units. Each cluster is assigned a number, or a FAT entry, which corresponds to its position on the disk.
In practice, a FAT file can be distributed over several clusters which may or may not be contained in the same or consecutive sectors on the disk. To read or access a file, the FAT file system checks the FAT to find all the clusters associated with the file. Conversely, to write or store a new file, the FAT file system checks the FAT to find clusters which are available on the disk. For backup and other purposes, duplicate copies of the FAT table are maintained by the FAT file system (i.e., a primary FAT table and a backup FAT table).
In the FAT file system, clusters are fixed in size and represent the smallest possible storage unit on a disk. Since each file wastes one half of a cluster on average, it is beneficial to keep cluster size small to efficiently conserve disk space. However, in the FAT file system, clusters are only addressable using a 16 bit address, and accordingly, there are a limited number of clusters available. As a result, as the disk size grows, so does the cluster size.
Many other file systems have been developed since the FAT file system. One such system is the OFS file system. OFS differs from the FAT file system in several ways. First, OFS uses only a small number of sectors to hold its primary meta data. Second, OFS uses 32 bits for clusters which allow a large number of clusters. Third, OFS uses a variety of complex data structures allowing "sparse" files (i.e. files in which some sections have holes or contain no data).
As new files systems are developed, users often wish to convert to the newer file systems to take advantage of the new file systems' capabilities. For example, users may wish to convert from the FAT file system to the OFS file system. However, converting from one file system to another is typically a non-trivial procedure which often involves a significant amount of user time and an ever present danger of losing file integrity and data.
Several prior art procedures have been developed to convert files from one file system (a source file system) to another file system (a target file system). One procedure entails 1) backing up the hard disk which contains the source file system, 2) formatting the hard disk with the target file system, and 3) restoring the individual files onto the target file system. While workable, the above procedure has certain drawbacks and deficiencies. A major drawback in the above procedure is that it is time consuming from a user standpoint. Backing up, formatting and restoring an entire hard disk usually requires a substantial amount of user participation and a substantial amount of down-time for the system. Further, this procedure requires an auxiliary backup mechanism to be available, such as a magnetic tape drive with magnetic tape or a floppy disk drive with a set of disks. The latter method of using a floppy disks is not viable to backup large hard disks.
Another procedure entails an on-the-fly-conversion of the file system which converts the file system without requiring the hard disk to be reformatted. This type of conversion has been used to convert files from the FAT file system to Windows NT.TM. NTFS and has also been used to convert files from the OS/2 file system HPFS to Windows NT.TM. NTFS. In this procedure, a conversion program typically analyzes each of the files on the source file system and creates the appropriate target file data structure information, i.e. meta data, for the files. This target file meta information, which includes pointers to all of the individual files in the source file system, is necessary for the target file system to access and maintain the files. After the target file meta information is verified, the boot record is updated to point to the new meta data, thereby completing the conversion of the disk to the target file system.
A major problem associated with on-the-fly conversion methods is that the conversion program must know the detailed intricacies of both the source file system and the target file system. As a result, the conversion programs are typically large and complex, difficult to code and difficult to maintain as changes in the source or target file systems necessitate corresponding changes to the conversion program. If the conversion program does not have all the capabilities of the target file system, the conversion program may not be utilizing all of the benefits of the target file system. Of course, a more serious danger of losing data integrity may also exist.